/**
 * Created by leo on 10/28.
 */
(function () {
    'use strict';
    angular.module('Nav', [])
        .directive('navPath', function (tabService) {
            return {
                restrict: 'A',
                scope: {},
                link: function (scope) {
                    scope.tabService = tabService;
                    scope.pathText = function () {
                        var tab = tabService.getTabs()[tabService.activeTab()];
                        return (tab.pathText || tab.name).replace(/\n|(\/$)/g, '').replace(/\//g, ' > ');
                    }
                },
                replace: true,
                templateUrl: 'app/nav/nav-path.html'
            };
        });
}());